﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CMS.Controls
{
    public class MyNumericUpDown: NumericUpDown
    {


        protected override void WndProc(ref Message m)
        {

            base.WndProc(ref m);

            if (m.Msg == 0xf || m.Msg == 0x133)
            {
                Graphics g = CreateGraphics();
                //g.SmoothingMode = SmoothingMode.AntiAlias;

                if (Focused)
                {
                    g.DrawRectangle(Pens.SkyBlue, 0, 0, Width - 1, Height - 1);
                }
                else
                {
                    g.DrawRectangle(Pens.LightGray, 0, 0, Width - 1, Height - 1);
                }

                m.Result = IntPtr.Zero;
                g.Dispose();
            }
        }
    }


}
